//对外暴露配置路由(常量路由)
export const constantRoute = [
  {
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    name: "login",
    meta: {
      title: "登录", //菜单标题
      hidden: true,
      icon: "Promotion",
    },
  },
  {
    path: "/",
    component: () => import("@/layout/index.vue"),
    name: "home",
    meta: {
      title: "", //菜单标题
      hidden: true,
      icon: "HomeFilled",
    },
    redirect: "/home",
    children: [
      {
        path: "/home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页", //菜单标题
          hidden: false,
          icon: "HomeFilled",
        },
      },
    ],
  },
  {
    path: "/404",
    component: () => import("@/views/404/index.vue"),
    name: "error",
    meta: {
      title: "404", //菜单标题
      hidden: true,
    },
  },
  // {
  //   path: "/screen",
  //   component: () => import("@/views/screen/index.vue"),
  //   name: "screen",
  //   meta: {
  //     title: "数据大屏", //菜单标题
  //     hidden: false,
  //     icon: "Platform",
  //   },
  // },
  // {
  //   path: "/translate",
  //   component: () => import("@/views/translate/index.vue"),
  //   name: "translate",
  //   meta: {
  //     title: "翻译", //菜单标题
  //     hidden: false,
  //     icon: "InfoFilled",
  //   },
  // },
  // {
  //   path: "/chat",
  //   component: () => import("@/views/chat/index.vue"),
  //   name: "chat",
  //   meta: {
  //     title: "人工智能", //菜单标题
  //     hidden: false,
  //     icon: "Comment",
  //   },
  // }
];

export const url = "acl/user";
let modules = import.meta.glob("../views/**/**/index.vue");
//异步路由
export const asnycRoute = [
  {
    path: "/acl",
    component: () => import("@/layout/index.vue"),
    name: "Acl",
    meta: {
      title: "权限管理",
      icon: "Lock",
    },
    redirect: "/acl/user",
    children: [
      {
        path: "/acl/user",
        component: modules[`../views/${url}/index.vue`],
        name: "User",
        meta: {
          title: "用户管理",
          icon: "User",
        },
      },
      {
        path: "/acl/role",
        component: () => import("@/views/acl/role/index.vue"),
        name: "Role",
        meta: {
          title: "角色管理",
          icon: "UserFilled",
        },
      },
      {
        path: "/acl/menu",
        component: () => import("@/views/acl/menu/index.vue"),
        name: "menu",
        meta: {
          title: "菜单管理",
          icon: "Monitor",
        },
      },
    ],
  },
];

//任意路由
export const anyRoute = {
  //任意路由
  path: "/:pathMatch(.*)*",
  redirect: "/404",
  name: "Any",
  meta: {
    title: "任意路由",
    hidden: true,
    icon: "DataLine",
  },
};
